﻿using DocumentFormat.OpenXml.Lite.DrawingML.Chart.Elements;
using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.Shared;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Chart
{
    [XmlRoot("lineChart", Namespace = Constants.Chart)]
    public class LineChart : XmlSerializable, IChartElement 
    {
        [Optional]
        [XmlElement("grouping", Namespace = Constants.Chart)]
        public NullableValue<ST_Grouping> Grouping { get; set; }

        [Optional]
        [XmlElement("varyColors", Namespace = Constants.Chart)]
        public NullableValue<bool> VaryColors { get; set; }

        [Optional]
        [XmlElement("ser", Namespace = Constants.Chart)]
        public XmlList<LineSeries> Series { get; set; }

        [Optional]
        [XmlElement("dLbls", Namespace = Constants.Chart)]
        public DataLabels DataLabels { get; set; }

        [Optional]
        [XmlElement("dropLines", Namespace = Constants.Chart)]
        public LineBar DropLines { get; set; }

        [Optional]
        [XmlElement("hiLowLines", Namespace = Constants.Chart)]
        public LineBar HighLowLines { get; set; }

        [Optional]
        [XmlElement("upDownBars", Namespace = Constants.Chart)]
        public UpDownBars UpDownBars { get; set; }

        [Optional]
        [XmlElement("marker", Namespace = Constants.Chart)]
        public NullableValue<bool> Marker { get; set; }

        [Optional]
        [XmlElement("smooth", Namespace = Constants.Chart)]
        public NullableValue<bool> Smooth { get; set; }

        [XmlElement("axId", Namespace = Constants.Chart)]
        public RequiredValue<uint> Axis1Id { get; set; }

        [XmlElement("axId", Namespace = Constants.Chart)]
        public RequiredValue<uint> Axis2Id { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Chart)]
        public ExtensionList ExtensionList { get; set; }

        public LineChart() 
        {
            Series = new XmlList<LineSeries>();
        }
    }
}
